package com.cwvs.utils;

import java.nio.charset.Charset;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;


public abstract class ResponseUtil {
  public static ResponseEntity<String> toJsonResponse(Object jsonData) {
      HttpHeaders headers = new HttpHeaders();
      MediaType mt = new MediaType("text", "html", Charset.forName("UTF-8"));
      headers.setContentType(mt);
      ResponseEntity<String> re = null;
      String body = JsonUtil.toJson(jsonData);
      re = new ResponseEntity<String>(body, headers, HttpStatus.OK);
      return re;
  }
}
